package main.Q2701_2800;

import java.util.HashSet;
import java.util.Set;

public class Q2741_2750 {
    public static void main(String[] args) {
        System.out.println("Question2741：");
        System.out.println("Question2742：");
        System.out.println("Question2743：");
        System.out.println("Question2744：最大字符串配对数目");
        System.out.println("Question2745：");
        System.out.println("Question2746：");
        System.out.println("Question2747：");
        System.out.println("Question2748：");
        System.out.println("Question2749：");
        System.out.println("Question2750：");
    }
}

class Question2744 {
    public boolean process(String str) {
        return new StringBuffer(str).reverse().toString().equals(str);
    }

    public int maximumNumberOfStringPairs(String[] words) {
        Set<String> set = new HashSet<>();
        int count = 0;
        for (String word : words) {
            set.add(word);
        }
        for (String word : words) {
            StringBuffer str = new StringBuffer(word);
            String s = str.reverse().toString();
            if (set.contains(s) && !process(word)) {
                count++;
                set.remove(s);
                set.remove(word);
            }
        }
        return count;
    }
}